package com.example.exam.authorization.service;

import com.example.exam.authorization.dao.AuthorizationDao;
import com.example.exam.authorization.model.AuthorizationBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AuthorizationService {
    @Autowired
    AuthorizationDao authorizationDao;
    /**
     * @Description:获取用户岗位
     * @Param: [id]
     * @return: java.lang.String
     * @Author: xhw
     * @Date: 2021/7/26
     */
    public String findPost(Integer id){

        AuthorizationBean authorizationBean=authorizationDao.findPost(id);
        if(authorizationBean==null){
            return null;
        }else{
            return authorizationBean.getPost();
        }
    }
    /**
     * @Description:判断用户是否为超级管理员
     * @Param: [id]
     * @return: java.lang.Integer
     * @Author: xhw
     * @Date: 2021/7/26
     */
    public Integer findRole(Integer id){
        AuthorizationBean authorizationBean=authorizationDao.findRole(id);
        return authorizationBean.getNum();
    }
}
